package com.ujs.edu.medicine.dao;

import com.ujs.edu.medicine.dataobject.YunjiayiStatus;
import java.util.List;

import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
@Mapper
public interface YunjiayiStatusMapper {
    @Delete({
        "delete from yunjiayi_status",
        "where statusId = #{statusid,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer statusid);

    @Insert({
        "insert into yunjiayi_status (statusId, mestatus, ",
        "prestatus, doctstatus)",
        "values (#{statusid,jdbcType=INTEGER}, #{mestatus,jdbcType=VARCHAR}, ",
        "#{prestatus,jdbcType=VARCHAR}, #{doctstatus,jdbcType=VARCHAR})"
    })
    int insert(YunjiayiStatus record);

    @Select({
        "select",
        "statusId, mestatus, prestatus, doctstatus",
        "from yunjiayi_status",
        "where statusId = #{statusid,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="statusId", property="statusid", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="mestatus", property="mestatus", jdbcType=JdbcType.VARCHAR),
        @Result(column="prestatus", property="prestatus", jdbcType=JdbcType.VARCHAR),
        @Result(column="doctstatus", property="doctstatus", jdbcType=JdbcType.VARCHAR)
    })
    YunjiayiStatus selectByPrimaryKey(Integer statusid);

    @Select({
        "select",
        "statusId, mestatus, prestatus, doctstatus",
        "from yunjiayi_status"
    })
    @Results({
        @Result(column="statusId", property="statusid", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="mestatus", property="mestatus", jdbcType=JdbcType.VARCHAR),
        @Result(column="prestatus", property="prestatus", jdbcType=JdbcType.VARCHAR),
        @Result(column="doctstatus", property="doctstatus", jdbcType=JdbcType.VARCHAR)
    })
    List<YunjiayiStatus> selectAll();

    /*通过处方id查询状态*/

    @Update({
        "update yunjiayi_status",
        "set mestatus = #{mestatus,jdbcType=VARCHAR},",
          "prestatus = #{prestatus,jdbcType=VARCHAR},",
          "doctstatus = #{doctstatus,jdbcType=VARCHAR}",
        "where statusId = #{statusid,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(YunjiayiStatus record);
}